<table style="width:100%;" cellspacing="0">
    <tr>
        <td>
        {$jsValMess}
        {messages block='Memberships'}
        {foreach from=$aMemberships item=aMembership}
        <a name="memb{$aMembership.membership_id}"></a>

        <form method="post" action="{$sUrl}" enctype="multipart/form-data">
        {if !$sCreate}
        <input type="hidden" name="aMemb[membership_id]" value="{$aMembership.membership_id}" />
		{/if}

        <table cellspacing="0" width="100%" class="forumline">
            <tr>
                <td class="row-header" colspan="2">
                <span>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                        {if $sCreate}
                        {language text='menu.memberships.create_new'}
                        {else}
                        	{language text='Mod_Account.usergroup'}: {$aMembership.title} (ID: {$aMembership.membership_id})
                        {/if}
                        </td>
                        <td style="text-align: right; padding-bottom: 4px;">
                            {if !$aMembership.is_special}
                                {if $aMembership.membership_id>3}<input type="submit" name="act[delete_membership]" value="{language text='Mod_Account.delete_membership'}" style="cursor:pointer;font-size:10pt;" onclick="return sure();"/>&nbsp;{/if}
                            {/if}
                        </td>
                    </tr>
                    </table>
                    </span>
                </td>
            </tr>
            <tr>
                <th align="center" colspan="2">
				{language text='Mod_Account.general_settings'}
                </th>
            </tr>

            <tr>
                <td class="row1" style="font-size: 8pt; width: 60%; text-align: right;">{language text="membership_title"}:</td>
                <td class="row2" style="font-size: 8pt; width: 40%;"><input class="input" size="40" name="aMemb[title]" value="{$aMembership.title}"></td>
            </tr>

            {if !$aMembership.is_special}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="position"}:</td>
                <td style="width:40%;font-size:8pt;" class="row2">
                    <input type="text" name="aMemb[pos]" size="40" class="input" value="{$aMembership.pos}" />
                </td>
            </tr>
            {/if}

            {if 2 != $aMembership.membership_id}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">
                	{language text="main_image"}:
                	<div style="padding:4px;">
                	{if !$sCreate}
					{language text='Mod_Account.note_images'} "/file/pic/membership/"
					{else}
					{language text='Mod_Account.advised_dimensions'}
					{/if}
					</div>
                </td>
                <td style="width:40%;font-size:8pt;" class="row2">
                	{if !$sCreate}
                	<select name="aMemb[img]" style="width:150px;" onchange="document.getElementById('mem_image').src='file/pic/membership/'+ this.value +'';">
                		{html_options options=$aMemImages selected=$aMembership.img}
                	</select>
                	<img src="file/pic/membership/{$aMembership.img}" alt="" id="mem_image" style="vertical-align:top;" />
                	{else}
					{if !$isWritable}
					{$sDestPath}
					{else}
					<input type="file" name="image" />
					{/if}
                	{/if}
                </td>
            </tr>
            {/if}

            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="turn_off_advertisement"}:</td>
                <td style="width:40%;font-size:8pt;" class="row2"><select name="aMemb[no_ads]" style="width:150px;">
                    <option value="1" {if 1 ==$aMembership.no_ads} selected{/if}>{language text="yes"}</option>
                    <option value="0" {if 0 ==$aMembership.no_ads} selected{/if}>{language text="no"}</option>
                </select></td>
            </tr>

            {if 2 != $aMembership.membership_id}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="blocking_off_users"}:</td>
                <td style="width:40%;font-size:8pt;" class="row2"><select name="aMemb[allow_block]" style="width:150px;">
                    <option value="1" {if 1 ==$aMembership.allow_block} selected{/if}>{language text="yes"}</option>
                    <option value="0" {if 0 ==$aMembership.allow_block} selected{/if}>{language text="no"}</option>
                </select></td>
            </tr>

            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="use_design_tool_for_profile_pages"}:</td>
                <td style="width:40%;font-size:8pt;" class="row2"><select name="aMemb[design_tool]" style="width:150px;">
                    <option value="1" {if 1 ==$aMembership.design_tool} selected{/if}>{language text="yes"}</option>
                    <option value="0" {if 0 ==$aMembership.design_tool} selected{/if}>{language text="no"}</option>
                </select></td>
            </tr>

            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="max_upload_space_in_bytes"}: <br />
                ( 0 {language text="for_no_limit"} )</td>
                <td style="width:40%;font-size:8pt;" class="row2"><input type="text" name="aMemb[max_upload]" size="40" class="input" value="{$aMembership.max_upload}" /></td>
            </tr>

            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="inbox_limit"}: <br />
                ( 0 {language text="no_limit"} )</td>
                <td style="width:40%;font-size:8pt;" class="row2"><input type="text" name="aMemb[max_inbox]" size="40" class="input" value="{$aMembership.max_inbox}" /></td>
            </tr>
            {/if}

			{if !$aMembership.is_special}
            <tr>
                <th align="center" colspan="2">
				{language text='Mod_Account.sub_settings'}
				</th>
            </tr>
			{if !getParam('sub_system')}
			 <tr>
                <td class="catBottom" colspan="2" style="text-align:center;">
					{language text='Mod_Account.notice_sub_system'} <br />
					{language text='Mod_Account.can_be_done'}: <a href="{url link='admin.config.core' edit='subscription'}">{language text='Mod_Account.sub_url'}</a>
                </td>
			</tr>
			{/if}
            {if $bIsSubscr}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="subscription_price"}: ( {language text="example_2_95_0_00_for_free_membersh"} )</td>
                <td style="width:40%;font-size:8pt;" class="row2"><input type="text" name="aMemb[price]" size="40" class="input" value="{$aMembership.price}" /></td>
            </tr>
            {/if}

            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="little_about_the_payment_plan"} ( {language text="no_html"} )</td>
                <td style="width:40%;font-size:8pt;" class="row2"><textarea name="aMemb[descr]" cols="30" rows="4">{$aMembership.descr}</textarea></td>
            </tr>

            {if $bIsSubscr}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">{language text="payment_setup"}:</td>
                <td style="width:40%;font-size:8pt;" class="row2"><select name="aMemb[pay_type]">
                    <option value="onetime"{if 'onetime' == $aMembership.pay_type} selected="selected"{/if}>{language text="one_time_payment"}</option>
                    <option value="monthly"{if 'monthly' == $aMembership.pay_type} selected="selected"{/if}>{language text="monthly"}</option>
                </select></td>
            </tr>
            {/if}
            {/if}

            {if 0 != $aMembership.membership_id && 1 != $aMembership.membership_id}
            <tr>
                <th align="center" colspan="2">
				{language text='Mod_Account.general_permissions'}
                </th>
            </tr>
            {foreach from=$aMembership.perms item=aPerm}
            {if is_array($aPerm.vals)}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">
                	{$aPerm.perm_name}{if !$aPerm.type} {language text="permissions_aperm_perm_name_section"}{/if}:
                </td>
                <td style="width:40%;font-size:8pt;" class="row2">
                {if $aPerm.type}
					<input type="text" name="aPerm[{$aPerm.module_perm_id}]" value="{$aPerm.val}" />
                {else}
                	<select name="aPerm[{$aPerm.module_perm_id}]" style="width:150px;">
                    	{html_options options=$aPerm.vals selected=$aPerm.val}
                	</select>
                {/if}
                </td>
            </tr>
            {/if}
            {/foreach}
            {/if}
            
            {if 2 != $aMembership.membership_id}
            {foreach from=$aMembership.extra item=aExtra}
            <tr>
                <th align="center" colspan="2">
				{$aExtra.temp}
                </th>
            </tr>
            {foreach from=$aExtra.items item=aExtraItem}
            <tr>
                <td style="width:60%;font-size:8pt;text-align:right;" class="row1">
                	{$aExtraItem.perm_name}
                </td>
                <td style="width:40%;font-size:8pt;" class="row2">
                	<input type="text" name="aPerm[{$aExtraItem.module_perm_id}]" value="{$aExtraItem.val}" />
                	{if getParam('debug')}
                	{$aExtraItem.code}
                	{/if}
                </td>
            </tr>
            {/foreach}
            {/foreach}
            {/if}

        </table>

        <table cellspacing="0" width="100%" class="forumline" style="border-top:0px;">
            <tr>
                <td class="catBottom" colspan="2" style="text-align:center;">
                	<span>
                	{if $sCreate}
                		<input style="font-size: 10pt; cursor: pointer;" name="act[create_membership]" value="&gt;&gt; {language text="create_membership"} &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;" type="submit">
					{else}
                        <input type="submit" name="act[update_membership]" value="&gt;&gt; {language text='save_settings'} &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;" style="cursor:pointer;font-size:10pt;" />
					{/if}
                    </span>
                </td>
            </tr>
        </table>

        </form>
        <br /><br />
        {/foreach}
        <br />

        </td>
    </tr>
</table>
<br />
<br />